*This file runs the regressions for Table A5


foreach p in "5" "10" "20"{


*TWFE AG 1974 AG EFFECT
*******************************************************************************


*TWFE Estimator Y = %AG, main table

eststo clear
*Baseline with no rezxt controls
reghdfe agpct post Ag`p'_post , absorb(ID stateXyear) cluster(TOWNSHIP)
sum agpct if e(sample) ==1
estadd scalar MDV = r(mean)
est sto twfe_ag_ag74_`p'_1

*off-rez population
reghdfe agpct post  Ag`p'_post offrespop , absorb(ID stateXyear) cluster(TOWNSHIP)
sum agpct if e(sample) ==1
estadd scalar MDV = r(mean)
lincom  post + Ag`p'_post
est sto twfe_ag_ag74_`p'_2

*casinos
reghdfe agpct post  Ag`p'_post has_casino, absorb(ID stateXyear) cluster(TOWNSHIP)
sum agpct if e(sample) ==1
estadd scalar MDV = r(mean)
est sto twfe_ag_ag74_`p'_3

*credit
reghdfe agpct post Ag`p'_post has_credit, absorb(ID stateXyear) cluster(TOWNSHIP)
sum agpct if e(sample) ==1
estadd scalar MDV = r(mean)

est sto twfe_ag_ag74_`p'_4

*all rez-t controls
reghdfe agpct post Ag`p'_post offrespop has_casino has_credit, absorb(ID stateXyear) cluster(TOWNSHIP)
sum agpct if e(sample) ==1
estadd scalar MDV = r(mean)
est sto twfe_ag_ag74_`p'_5



}


*Table A5, Panel A
esttab twfe_ag_ag74_5*,  se(a3) b(a3) star(* 0.1 ** 0.05 *** 0.01) ar2  replace   scalar(N_clust M1 MDV )

*Table A5, Panel B
esttab twfe_ag_ag74_10*,  se(a3) b(a3) star(* 0.1 ** 0.05 *** 0.01) ar2  replace   scalar(N_clust M1 MDV )

*Table A5, Panel C
esttab twfe_ag_ag74_20*,  se(a3) b(a3) star(* 0.1 ** 0.05 *** 0.01) ar2  replace   scalar(N_clust M1 MDV )
